package com.ruoyi.ysg.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.ysg.domain.YsgOrder;
import com.ruoyi.ysg.mapper.YsgOrderMapper;
import com.ruoyi.ysg.service.IYsgOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 学生订单Service业务层处理
 * 
 * @author xsz
 * @date 2025-11-28
 */
@Service
public class YsgOrderServiceImpl implements IYsgOrderService
{
    @Autowired
    private YsgOrderMapper ysgOrderMapper;

    /**
     * 新增学生订单
     * 
     * @param ysgOrder 学生订单
     * @return 结果
     */
    @Override
    public int insertYsgOrder(YsgOrder ysgOrder)
    {
        ysgOrder.setCreateTime(DateUtils.getNowDate());
        ysgOrder.setUpdateTime(DateUtils.getNowDate());
        return ysgOrderMapper.insertYsgOrder(ysgOrder);
    }
    
    /**
     * 查询学生订单列表
     * 
     * @param ysgOrder 学生订单
     * @return 学生订单集合
     */
    @Override
    public java.util.List<YsgOrder> selectYsgOrderList(YsgOrder ysgOrder)
    {
        return ysgOrderMapper.selectYsgOrderList(ysgOrder);
    }
    
    /**
     * 查询学生订单
     * 
     * @param id 学生订单主键
     * @return 学生订单
     */
    @Override
    public YsgOrder selectYsgOrderById(Long id)
    {
        return ysgOrderMapper.selectYsgOrderById(id);
    }
}